import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)

const routes = [{
    path: '',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: () =>
      import ('@/views/Home/Home.vue'),
    children: [
      { path: '', redirect: 'discover' },
      {
        path: 'discover',
        component: () =>
          import ('@/views/Discover/Discover.vue'),
        children: [{
            path: '',
            redirect: 'recommend'
          },
          { path: 'recommend', component: () =>
              import ('@/views/Discover/Recommend.vue') },
          { path: 'ranklist', component: () =>
              import ('@/views/Discover/RankList.vue') },
          { path: 'songlist', component: () =>
              import ('@/views/Discover/SongList.vue') },
          { path: 'anchor', component: () =>
              import ('@/views/Discover/Anchor.vue') },
          { path: 'singer', component: () =>
              import ('@/views/Discover/Singer.vue') },
          { path: 'newdisc', component: () =>
              import ('@/views/Discover/NewDisc.vue') },
          { path: 'playlist', component: () =>
              import ('@/views/Discover/PlayList.vue') }
        ]
      },
      { path: 'mymusic', component: () =>
          import ('@/views/MyMusic/MyMusic.vue') },
      { path: 'friend', component: () =>
          import ('@/views/Friend/Friend.vue') },
      { path: 'shopping', component: () =>
          import ('@/views/Shopping/Shopping.vue') },
      { path: 'musiciam', component: () =>
          import ('@/views/Musiciam/Musiciam.vue') },
      { path: 'client', component: () =>
          import ('@/views/Client/Client.vue') }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router